home *** CD-ROM | disk | FTP | other *** search
- // adjust.cpp: Justify output
- #include <iostream.h>
- #include <iomanip.h>
-
- main()
- {
- cout << '|' << setw(10) << "hello" << '|' << endl;
-
- cout.setf(ios::left,ios::adjustfield);
- cout << '|' << setw(10) << "hello" << '|' << endl;
-
- cout.fill('#');
- cout << '|' << setw(10) << "hello" << '|' << endl;
- return 0;
- }
-
- // Output
- // | hello|
- // |hello |
- // |hello#####|
-
-